// 自动生成模板Sys_department
package system1

import (
	"github.com/flipped-aurora/gin-vue-admin/server/global"
	"github.com/flipped-aurora/gin-vue-admin/server/model/system"
)

// 部门 结构体  Sys_department
type Sys_department struct {
	global.GVA_MODEL
	Department_name string           `json:"departmentName" form:"departmentName" gorm:"column:department_name;comment:;size:100;"` //部门名称
	ParentId        int              `json:"parent_id" form:"parent_id" gorm:"column:parent_id;comment:;"`                          //父节点ID
	ManagerUserId   int              `json:"manager_user_id" form:"manager_user_id" gorm:"column:manager_user_id;comment:;"`        //部门经理ID
	CreatedBy       uint             `gorm:"column:created_by;comment:创建者"`
	UpdatedBy       uint             `gorm:"column:updated_by;comment:更新者"`
	DeletedBy       uint             `gorm:"column:deleted_by;comment:删除者"`
	Employees       []system.SysUser `json:"employees" gorm:"foreignKey:DepartmentId;association_foreignKey:ID"`
}

// TableName 部门 Sys_department自定义表名 sys_department
func (Sys_department) TableName() string {
	return "sys_department"
}
